@import './variables.scss';

/* 全局样式 */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: $font-family;
  font-size: $font-size-base;
  color: $text-primary;
}

// 清除浮动
.clearfix {
  &::after {
    display: block;
    content: "";
    clear: both;
  }
}

// 文本溢出处理
.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

// 多行文本溢出
.multi-ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

// 页面容器
.page-container {
  padding: $spacing-md;
  background-color: #fff;
  border-radius: $border-radius-base;
  min-height: calc(100vh - 120px);
}

// 页面标题
.page-title {
  margin-bottom: $spacing-md;
  font-size: $font-size-xl;
  font-weight: 600;
  color: $text-primary;
}

// 操作按钮区域
.operation-container {
  margin-bottom: $spacing-md;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

// 表格区域
.table-container {
  margin-bottom: $spacing-md;
}

// 分页区域
.pagination-container {
  margin-top: $spacing-md;
  display: flex;
  justify-content: flex-end;
}

// 表单区域
.form-container {
  max-width: 800px;
  margin: 0 auto;
}

// 表单底部操作区
.form-footer {
  margin-top: $spacing-lg;
  text-align: center;
  
  button {
    margin: 0 $spacing-sm;
  }
}

// 详情页
.detail-container {
  .detail-header {
    margin-bottom: $spacing-md;
    border-bottom: 1px solid $border-color-light;
    padding-bottom: $spacing-md;
  }
  
  .detail-item {
    margin-bottom: $spacing-md;
    
    .detail-label {
      color: $text-secondary;
      margin-bottom: $spacing-sm;
    }
    
    .detail-value {
      color: $text-primary;
    }
  }
}

// 卡片样式
.card {
  border-radius: $border-radius-base;
  border: 1px solid $border-color-light;
  background-color: #fff;
  overflow: hidden;
  transition: all .3s;
  margin-bottom: $spacing-md;
  
  &:hover {
    box-shadow: $box-shadow-light;
  }
  
  .card-header {
    padding: $spacing-md;
    border-bottom: 1px solid $border-color-light;
    font-weight: 600;
    font-size: $font-size-lg;
  }
  
  .card-body {
    padding: $spacing-md;
  }
  
  .card-footer {
    padding: $spacing-md;
    border-top: 1px solid $border-color-light;
    background-color: $background-color-base;
  }
}

// 状态标签
.status-tag {
  display: inline-block;
  padding: 0 10px;
  height: 32px;
  line-height: 30px;
  border-radius: 16px;
  font-size: $font-size-sm;
  
  &.success {
    background-color: rgba($success-color, 0.1);
    color: $success-color;
    border: 1px solid rgba($success-color, 0.2);
  }
  
  &.warning {
    background-color: rgba($warning-color, 0.1);
    color: $warning-color;
    border: 1px solid rgba($warning-color, 0.2);
  }
  
  &.danger {
    background-color: rgba($danger-color, 0.1);
    color: $danger-color;
    border: 1px solid rgba($danger-color, 0.2);
  }
  
  &.info {
    background-color: rgba($info-color, 0.1);
    color: $info-color;
    border: 1px solid rgba($info-color, 0.2);
  }
  
  &.primary {
    background-color: rgba($primary-color, 0.1);
    color: $primary-color;
    border: 1px solid rgba($primary-color, 0.2);
  }
}

// 自定义Element UI样式
.el-table {
  .el-table__header-wrapper,
  .el-table__fixed-header-wrapper {
    th {
      background-color: $background-color-base;
      color: $text-primary;
      font-weight: 600;
      
      .cell {
        padding: 8px 12px;
      }
    }
  }
  
  td {
    padding: 8px 0;
  }
}

.el-pagination {
  padding: 20px 0;
  text-align: right;
}

.el-form-item {
  margin-bottom: 22px;
}

// 响应式样式
@media (max-width: $md) {
  .form-container {
    max-width: 100%;
  }
  
  .operation-container {
    flex-direction: column;
    align-items: flex-start;
    
    .el-button-group {
      margin-bottom: $spacing-md;
    }
  }
  
  .pagination-container {
    justify-content: center;
  }
} 